package com.haozi.ehub.core.util;

import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;

import javax.servlet.http.HttpServletResponse;

/**
 * @author ：terry
 * @date ：Created in 2020/7/13 17:43
 * @description：TODO
 * @version: 1.0
 */
public class ResponseUtils {

    public static void setHttpSerlvetResponse(HttpServletResponse httpServletResponse){
        //解决返回数据跨域问题
        httpServletResponse.addHeader(HttpHeaders.ACCESS_CONTROL_ALLOW_ORIGIN, CodeUtils.ALL);
        httpServletResponse.setContentType(CodeUtils.HTTP_CONTENT_TYPE_JSON);
        httpServletResponse.setCharacterEncoding(CodeUtils.UTF8_L);
        httpServletResponse.setStatus(HttpStatus.OK.value());
    }
}
